/*
 * Copyright (C) 2016  Nicola Spanti (RyDroid) <dev@nicola-spanti.info>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */


#include "PlanetWars2dRT-core/specific/model/ship_size.h"


EXTERN_C_BEGIN


bool
ship_set_width(ship_t* a_ship, unsigned int value)
{
  if(a_ship == NULL || value == 0)
    {
      return false;
    }
  a_ship->size.x = value;
  return true;
}

bool
ship_set_height(ship_t* a_ship, unsigned int value)
{
  if(a_ship == NULL || value == 0)
    {
      return false;
    }
  a_ship->size.y = value;
  return true;
}

bool
ship_set_size(ship_t* a_ship, const size_2d_uint* value)
{
  if(a_ship == NULL || value == NULL)
    {
      return false;
    }
  
  return
    ship_set_width (a_ship, value->x) &&
    ship_set_height(a_ship, value->y);
}


EXTERN_C_END
